$(document).ready(function(){
	var p=1;
	var $this=$('.slideBox');
	var pLen=$this.find('li').length;
	var pWidth=$(window).width()-10;
	if(pWidth>630){
		pWidth=630;
	}
	var tWidth=pWidth*pLen/2;
	$(this).find('ul').css({width:tWidth});
	$(this).find('li').each(function(index){
		$(this).css({width:pWidth/2});
		
	})
	
	$this.find('.controll-btn.next').on("tap",function(){
		p=p+1;
		if(p>=pLen){
			p=1;
		}
		goPage(p);
	})
	$this.find('.controll-btn.prev').on("tap",function(){
		p=p-1;
		if(p<=1){
			p=pLen;
		}
		goPage(p);
	})
	
	
	function goPage(p){
		if(p<pLen){
			$('.slideBox ul').animate({marginLeft:-(pWidth/2*(p-1))+'px'});
		}else{
			p=1;
			$('.slideBox ul').animate({marginLeft:'0'});
		}
	}
})



$('.mainContent .listBox .item').on('tap',function(){
	location.href=MPJ.base+"/pages/features-detail.jsp";
})


